package com.cjkj;

import com.cjkj.equipment.handler.TJ02Handler;
import com.cjkj.equipment.handler.TJ03Handler;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * 启动程序
 * 
 * @author cjkj
 */
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class Application {

    @Resource(name = "tj02Handler")
    private TJ02Handler tj02Handler;
    @Resource(name = "tj03Handler")
    private TJ03Handler tj03Handler;

    private static Application application;
    @PostConstruct
    public void init() {
        application = this;
        application.tj02Handler = this.tj02Handler;
        application.tj03Handler = this.tj03Handler;
    }

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);

        application.tj02Handler.initAmqp();
        application.tj03Handler.initAmqp();

        System.out.println("(♥◠‿◠)ﾉﾞ  启动成功   ლ(´ڡ`ლ)ﾞ ");
    }
}